<template>
	<view class="contribute-wrapper" @click.native="checkDialogToggle">
		<view class="contribute">
			<view>
				<text class="contribute-title">受捐情况</text>
			</view>
			<view class="contribute-content">
				<text class="fix-txt">已获捐</text>
				<rich-text class="contribute-content-txt">{{ value }}</rich-text>
				<text class="fix-txt">元</text>
			</view>
		</view>

		<view>
			<uni-popup ref="checkDialog" type="center">
				<view class="dialog-wrapper">
					<text class="title">受捐情况</text>
					<!-- <rich-text class="contribute-detail"></rich-text> -->
					<view class="item-box-wrapper">
						<view class="item-box" v-for="(item, index) in donate">
							<view class="donate-details">
								<text class="doner-name">{{donate[index].donorName}}</text>
								<text class="donate-time">{{new Date(donate[index].donateTime).toISOString().slice(0,10)}}</text>
								<text class="donate-money">{{donate[index].donateMoney}}元</text>
							</view>
<!-- 							<input type="text" placeholder="请输入">
							<button type="warning" @click="delItem(item)">删除</button> -->
						</view>
					</view>


					<view class="btn-dock">
						<button class="btn-cancel" @click="dialogCancel()">确定</button>
					</view>
				</view>
				<!--<uni-popup-dialog ref="inputClose"  mode="input" title="我的故事" value="我叫王小明..."
					placeholder="请输入故事" @confirm="dialogInputConfirm"></uni-popup-dialog>-->
			</uni-popup>
		</view>
	</view>
</template>

<script>
	import {
		BASE_URL
	} from '../../api';
	export default {
		name: "mycontribute",
		props: {
			userData: {
				type: Object,
				default: {},
			},
			donate: {
				type: Object,
				default: {},
			},
		},
		data() {
			return {
				value: '',
				id: '',
				data: {},
			};
		},
		updated() {
			// console.log("mycontribute:"+JSON.stringify(this.donate))
			this.value = this.donate.total
		},
		methods: {
			checkDialogToggle() {
				this.$refs.checkDialog.open()
			},
			dialogCancel() {
				this.$refs.checkDialog.close()
			},
		}
	}
</script>

<style>
	@import url("mycontribute.css");
</style>